package myJs.myPkg

import myJs.Implicits.JDJAn
import myJs.myPkg.jquery.JQuery
import myJs.myPkg.jsext._

import scala.scalajs.js
import scala.language.implicitConversions
import scala.scalajs.js.JSConverters._


/**
 * Created by yz on 2019/3/14
 */

@js.native
trait Resizable extends js.Object {

}

@js.native
trait ResizableJQuery extends js.Object {

  def resizable(options: ResizableOptions): JQuery = scalajs.js.native

}

object ResizableOptions extends ResizableOptionsBuilder(noOpts)

class ResizableOptionsBuilder(val dict: OptMap) extends JSOptionBuilder[ResizableOptions, ResizableOptionsBuilder](new ResizableOptionsBuilder(_)) {

  def handleSelector(v: String) = jsOpt("handleSelector", v)

  def resizeHeight(v: Boolean) = jsOpt("resizeHeight", v)

  def resizeWidth(v: Boolean) = jsOpt("resizeWidth", v)

  def resizeHeightFrom(v: String) = jsOpt("resizeHeightFrom", v)

  def resizeWidthFrom(v: String) = jsOpt("resizeWidthFrom", v)

  def onDrag(v: js.Function) = jsOpt("onDrag", v)

}

trait ResizableOptions extends js.Object {

}


trait ResizableJQueryImplicits {
  implicit def implicitResizableJQuery(jq: JQuery) = {
    jq.asInstanceOf[ResizableJQuery]
  }
}
